package com.example.config;

import com.example.interceptors.JWTInterceptors;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author 夏虫言冰
 * @date 2021/5/4 17:00
 */
@Configuration
public class IntetceptorConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
         registry.addInterceptor(new JWTInterceptors())
                 .addPathPatterns("/**")
                 .excludePathPatterns("/user/login");
    }
}
